require('module-alias/register')
const Koa = require('koa')
const parser = require('koa-bodyparser')
const static = require('koa-static')
const path = require('path')

const InitManager = require('./core/init.js')
const catchError = require('./middlewares/exception.js')

const app = new Koa()

app.use(catchError)
app.use(parser())
app.use(static(path.join(__dirname, './static')))

// 设置一下路由转发 配和test.js文件
app.use(static(path.join(__dirname, './view')))

// 初始化路由
InitManager.initCore(app)

app.listen(3000)